/*
 * @Description: 
 * @Author: Sang Hao
 * @Date: 2021-11-03 14:40:36
 * @LastEditTime: 2021-11-05 10:45:12
 * @LastEditors: Sang Hao
 */
#ifndef LIDAR_SLAM_MODELS_MESH_GENERATION_PAD_MESH_DATA_HPP_
#define LIDAR_SLAM_MODELS_MESH_GENERATION_PAD_MESH_DATA_HPP_

#include <yaml-cpp/yaml.h>

#include "lidar_slam/sensor_data/cloud_data.hpp"
#include "lidar_slam/sensor_data/mesh_data.hpp"

#include <map>

namespace lidar_slam {
class PolarMeshing {
private:
	/* data */
	float res_distance_;	/* 距离分辨率 */
	float res_angle_;	/* 角度分辨率 */
	std::map<int, MeshData> all_mesh_data_;

public:
	/* 将点云转化为all_mesh_data_数据 */
	bool CloudToMesh(const CloudData::CLOUD_PTR& input_cloud_ptr);
	bool SetMeshParam(float res_distance, float res_angle);

public:
	PolarMeshing(const YAML::Node& config_node);
	PolarMeshing(float res_distance, float res_angle);
	~PolarMeshing();
	/* 这个函数主要就是返回这个值的，all_mesh_data */
    bool GetAllMeshData(std::map<int, MeshData>& all_mesh_data);
	inline int Width() {return ceil(360.0 / res_angle_); }
};
}

#endif